﻿using System;

namespace Lesson14_练习题
{
    //写一个打工人基类 有工种与工作内容两个特征 一个工作方法
    //三个子类：程序 策划 美术分别继承打工人基类
    //实例化三个对象
    class Worker
    {
        private string workType;
        private string workDuty;
        public Worker(string workType, string workDuty)
        {
            this.workType = workType;
            this.workDuty = workDuty;
        }
        public void Working()
        {
            Console.WriteLine($"{workType}做{workDuty}");
        }
    }
    class Programmer : Worker
    {
        public Programmer() : base("程序", "写代码")
        {
            
        }
    }
    class Planner : Worker
    {
        public Planner() : base("策划", "内容设计")
        {

        }
    }
    class Art : Worker
    {
        public Art() : base("美术", "美术资源创作")
        {

        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Worker programmer = new Programmer();
            Worker planner = new Planner();
            Worker art = new Art();
            programmer.Working();
            planner.Working();
            art.Working();
        }
    }
}